home *** CD-ROM | disk | FTP | other *** search
/ Aminet 28 / Aminet 28 (1998)(GTI - Schatztruhe)[!][Dec 1998].iso / Aminet / dev / src / GLperf3.12-src.lha / GLperf / Vertex.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-08-01  |  11.7 KB  |  414 lines

  1. /*
  2.  *   (C) COPYRIGHT International Business Machines Corp. 1993
  3.  *   All Rights Reserved
  4.  *   Licensed Materials - Property of IBM
  5.  *   US Government Users Restricted Rights - Use, duplication or
  6.  *   disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  7.  
  8. //
  9. // Permission to use, copy, modify, and distribute this software and its
  10. // documentation for any purpose and without fee is hereby granted, provided
  11. // that the above copyright notice appear in all copies and that both that
  12. // copyright notice and this permission notice appear in supporting
  13. // documentation, and that the name of I.B.M. not be used in advertising
  14. // or publicity pertaining to distribution of the software without specific,
  15. // written prior permission. I.B.M. makes no representations about the
  16. // suitability of this software for any purpose.  It is provided "as is"
  17. // without express or implied warranty.
  18. //
  19. // I.B.M. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
  20. // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL I.B.M.
  21. // BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
  22. // WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
  23. // OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
  24. // CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  25. //
  26. // Author:  John Spitzer, IBM AWS Graphics Systems (Austin)
  27. //
  28. */
  29.  
  30. #if (defined(INC_REASON)) && (INC_REASON == INFO_ITEM_STRUCT)
  31. #include "Primitve.h"
  32.     int numInfiniteLights;/* [0,8]                                                        */
  33.     int numLocalLights; /* [0,8]                                                          */
  34.     GLfloat shininess;  /* [0.0,128.0]                                                    */
  35.     GLfloat specComp;   /* On or Off */
  36.     int colorMaterial;  /* GL_DIFFUSE, GL_AMBIENT_DIFFUSE, ...                            */
  37.     int colorMatSide;   /* GL_FRONT, GL_BACK, GL_FRONT_AND_BACK                           */
  38.     int localViewer;    /* On or Off                                                      */
  39.     int shadeModel;     /* GL_FLAT or GL_SMOOTH                                           */
  40.     int numVertices;    /* this should equal numBgnEnds * vertsPerBgnEnd                  */
  41.                         /*          OR       numBgnEnds * facetsPerBgnEnd * vertsPerFacet */
  42.     int orientation;    /* Can be Vertical, Horizontal, or Random                         */
  43.     float size;         /* Size of primitive in pixels must be > 0.0                      */
  44.     int antiAlias;      /* On or Off                                                      */
  45.     int primitiveType;  /* GL_POINTS, GL_LINES...                                         */
  46.     int vertexDim;      /* Dimension of vertex data (i.e. 2 or 3 D) [2, 3]   */
  47.  #ifdef GL_EXT_vertex_array
  48.     int vertexArray;    /* Use the vertex_array */
  49.  #endif
  50.  #ifdef GL_VERSION_1_1
  51.     int vertexArray11;    /* 1.1 vertex arrays */
  52.     int drawElements;
  53.     int interleavedData;
  54.  #endif
  55.  #ifdef GL_SGI_compiled_vertex_array
  56.     int lockArrays;
  57.  #endif
  58.     /* Members below this line aren't user settable */
  59.     int vertsPerFacet;
  60.     int vertsPerBgnEnd;
  61.     int facetsPerBgnEnd;
  62.     int objsPerBgnEnd;  /* number of objects drawn within glBegin/glEnd pair              */
  63.     int numBgnEnds;
  64.     float layoutPadding;/* amount of space in NDC from edge to first primitive center     */
  65.     float layoutLeft;
  66.     float layoutRight;
  67.     float layoutBottom;
  68.     float layoutTop;
  69.     int layoutPoints;
  70.     int layoutSides;
  71.  #if defined(GL_EXT_vertex_array) || defined(GL_VERSION_1_1)
  72.     GLsizei vertexStride;
  73.     int bgnendSize;
  74.     void* colorPtr;
  75.     void* indexPtr;
  76.     void* normalPtr;
  77.     void* texPtr;
  78.     void* vertexPtr;
  79.  #endif
  80.     /* void Initialize(TestPtr); */               /* virtual function */
  81.     /* void Cleanup(TestPtr); */                  /* virtual function */
  82.     /* void Execute(TestPtr);   */                /* virtual function */
  83.     /* int SetState(TestPtr);  */                 /* virtual function */
  84.     /* void SetExecuteFunc(TestPtr); */           /* virtual function */
  85.     /* float Size(TestPtr); */                    /* virtual function */
  86.     void (*Layout)(struct _Vertex *);             /* virtual function */
  87. #elif (defined(INC_REASON)) && (INC_REASON == INFO_ITEM_ARRAY)
  88. #include "Primitve.h"
  89. #ifdef GL_EXT_vertex_array
  90.     {
  91.         VertexArray,
  92.         "Use Vertex Array Extension",
  93.         offset(vertexArray),
  94.         Enumerated,
  95.         {
  96.             { False,                    "False" },
  97.             { True,                     "True" },
  98.             { End }
  99.         },
  100.         { False }
  101.     },
  102. #endif
  103. #ifdef GL_VERSION_1_1 
  104.     {
  105.     VertexArray11,
  106.     "Use 1.1 Vertex Arrays",
  107.     offset(vertexArray11),
  108.     Enumerated,
  109.         {
  110.             { False,                    "False" },
  111.             { True,                     "True" },
  112.             { End }
  113.         },
  114.         { False }
  115.     },
  116. #endif
  117.     {
  118.         Size,
  119.         "Primitive Size",
  120.         offset(size),
  121.         RangedFloatOrInt,
  122.         {
  123.             { .01 },
  124.             { 10000000 }
  125.         },
  126.         { NotUsed, 10.0 }
  127.     },
  128.     {
  129.         ObjsPerBeginEnd,
  130.         "Objects Per Begin/End Structure",
  131.         offset(objsPerBgnEnd),
  132.         RangedInteger,
  133.         {
  134.             { 1 },
  135.             { 100000 },
  136.         },
  137.         { 120 }
  138.     },
  139.     {
  140.         VertexDim,
  141.         "Dimension of Vertex Data",
  142.         offset(vertexDim),
  143.         RangedInteger,
  144.         {
  145. #ifdef FULL_VERTEX_PATHS
  146.             { 2 },
  147. #else
  148.         { 3 },
  149. #endif
  150.             { 3 },
  151.         },
  152.         { 3 }
  153.     },
  154.     {
  155.         Orientation,
  156.         "Orientation",
  157.         offset(orientation),
  158.         Enumerated,
  159.         {
  160.             { Random,                   "Random" },
  161.             { Vertical,                 "Vertical" },
  162.             { Horizontal,               "Horizontal" },
  163.             { End }
  164.         },
  165.         { Random }
  166.     },
  167.     {
  168.         Antialias,
  169.         "Antialiasing",
  170.         offset(antiAlias),
  171.         Enumerated,
  172.         {
  173.             { Off,                      "Off" },
  174.             { On,                       "On: GL_DONT_CARE" },
  175.             { GL_DONT_CARE,             "On: GL_DONT_CARE" },
  176.             { GL_FASTEST,               "On: GL_FASTEST" },
  177.             { GL_NICEST,                "On: GL_NICEST" },
  178.             { End }
  179.         },
  180.         { Off }
  181.     },
  182.     {
  183.         ColorData,
  184.         "Color/Index Data",
  185.         offset(colorData),
  186.         Enumerated,
  187.         {
  188.             { None,                     "None" },
  189.             { PerFacet,                 "PerFacet" },
  190.             { PerVertex,                "PerVertex" },
  191.             { End }
  192.         },
  193.         { None }
  194.     },
  195.     {
  196.         NormalData,
  197.         "Normal Data",
  198.         offset(normalData),
  199.         Enumerated,
  200.         {
  201.             { None,                     "None" },
  202.             { PerFacet,                 "PerFacet" },
  203.             { PerVertex,                "PerVertex" },
  204.             { End }
  205.         },
  206.         { None }
  207.     },
  208.     {
  209.         TexData,
  210.         "Texture Coordinate Data",
  211.         offset(textureData),
  212.         Enumerated,
  213.         {
  214.             { None,                     "None" },
  215.             { PerVertex,                "PerVertex" },
  216.             { End }
  217.         },
  218.         { None }
  219.     },
  220. #ifdef GL_SGI_compiled_vertex_array
  221.     {
  222.         LockArrays,
  223.         "Use LockArraysSGI",
  224.         offset(lockArrays),
  225.         Enumerated,
  226.         {
  227.             { False,                    "False" },
  228.             { True,                     "True" },
  229.             { End }
  230.         },
  231.         { None }
  232.     },
  233. #endif
  234. #ifdef GL_VERSION_1_1
  235.     {
  236.         DrawElements,
  237.         "Use DrawElements",
  238.         offset(drawElements),
  239.         Enumerated,
  240.         {
  241.             { False,                    "False" },
  242.             { True,                     "True" },
  243.             { End }
  244.         },
  245.         { None }
  246.     },
  247.     {
  248.         InterleavedData,
  249.         "Interleaved Data",
  250.         offset(interleavedData),
  251.         Enumerated,
  252.         {
  253.             { False,                    "False" },
  254.             { True,                     "True" },
  255.             { End }
  256.         },
  257.         { None }
  258.     },
  259. #endif
  260.     {
  261.         ShadeModel,
  262.         "Shading Model",
  263.         offset(shadeModel),
  264.         Enumerated,
  265.         {
  266.             { GL_SMOOTH,        "GL_SMOOTH" },
  267.             { GL_FLAT,          "GL_FLAT" },
  268.             { End }
  269.         },
  270.         { GL_SMOOTH }
  271.     },
  272.     {
  273.         LocalLights,
  274.         "Number of Local Lights",
  275.         offset(numLocalLights),
  276.         RangedInteger,
  277.         {
  278.             { 0 },
  279.             { 8 }
  280.         },
  281.         { 0 }
  282.     },
  283.     {
  284.         InfiniteLights,
  285.         "Number of Infinite Lights",
  286.         offset(numInfiniteLights),
  287.         RangedInteger,
  288.         {
  289.             { 0 },
  290.             { 8 }
  291.         },
  292.         { 0 }
  293.     },
  294.     {
  295.         SpecularComponent,
  296.         "Specular Component",
  297.         offset(specComp),
  298.         Enumerated,
  299.         {
  300.         { On,  "On" },
  301.         { Off, "Off" },
  302.         { End }
  303.         },
  304.         { On }
  305.     },
  306.     {
  307.         Shininess,
  308.         "Shininess",
  309.         offset(shininess),
  310.         RangedFloatOrInt,
  311.         {
  312.             { 0.0 },
  313.             { 128.0 }
  314.         },
  315.         { NotUsed, 10.0 }
  316.     },
  317.     {
  318.         LocalViewer,
  319.         "Local Viewer",
  320.         offset(localViewer),
  321.         Enumerated,
  322.         {
  323.             { Off,                      "Off" },
  324.             { On,                       "On" },
  325.             { End }
  326.         },
  327.         { Off }
  328.     },
  329.     {
  330.         ColorMaterialMode,
  331.         "Color Material Properties",
  332.         offset(colorMaterial),
  333.         Enumerated,
  334.         {
  335.             { GL_EMISSION,              "GL_EMISSION" },
  336.             { GL_AMBIENT,               "GL_AMBIENT" },
  337.             { GL_DIFFUSE,               "GL_DIFFUSE" },
  338.             { GL_SPECULAR,              "GL_SPECULAR" },
  339.             { GL_AMBIENT_AND_DIFFUSE,   "GL_AMBIENT_AND_DIFFUSE" },
  340.             { End }
  341.         },
  342.         { GL_AMBIENT_AND_DIFFUSE }
  343.     },
  344.     {
  345.         ColorMaterialSide,
  346.     "Color Material Side",
  347.     offset(colorMatSide),
  348.     Enumerated,
  349.     {
  350.         { GL_FRONT,            "GL_FRONT" },
  351.         { GL_BACK,            "GL_BACK" },
  352.         { GL_FRONT_AND_BACK,    "GL_FRONT_AND_BACK" },
  353.             { End }
  354.     },
  355.         { GL_FRONT }
  356.     },
  357. #else  /* INC_REASON not defined, treat as plain include */
  358. #ifndef _Vertex_h
  359. #define _Vertex_h
  360.  
  361. #include "Primitve.h"
  362. #include "General.h"
  363. #include "Print.h"
  364. #include "TestName.h"
  365. #include "PropName.h"
  366. #include "Global.h"
  367. #include "AttrName.h"
  368. #ifdef WIN32
  369. #include <windows.h>
  370. #endif
  371. #include <GL/gl.h>
  372. #include <GL/glu.h>
  373. #include "Random.h"
  374. #include "FuncEnum.h"
  375.  
  376. typedef struct _Vertex {
  377. #define INC_REASON INFO_ITEM_STRUCT
  378. #include "Vertex.h"
  379. #undef INC_REASON
  380. } Vertex, *VertexPtr;
  381.  
  382. void new_Vertex(VertexPtr);
  383. void delete_Vertex(TestPtr);
  384. void Vertex__AddTraversalData(VertexPtr);
  385. int Vertex__SetState(TestPtr);
  386. void Vertex__Initialize(TestPtr);
  387. void Vertex__Cleanup(TestPtr);
  388. void Vertex__SetExecuteFunc(TestPtr);
  389. void Vertex__Layout(VertexPtr);
  390. float Vertex__Size(TestPtr);
  391.  
  392. #ifdef WIN32
  393.     /* The copy of VC++ that I have has no prototypes for these functions!!! */
  394.     WINGDIAPI void APIENTRY glVertexPointerEXT(GLint, GLenum, GLsizei, GLsizei, const GLvoid*);
  395.     WINGDIAPI void APIENTRY glDrawArraysEXT(GLenum, GLint, GLsizei);
  396.     WINGDIAPI void APIENTRY glNormalPointerEXT(GLenum, GLsizei, GLsizei, const GLvoid*);
  397.     WINGDIAPI void APIENTRY glColorPointerEXT(GLint, GLenum, GLsizei, GLsizei, const GLvoid*);
  398.     WINGDIAPI void APIENTRY glIndexPointerEXT(GLenum, GLsizei, GLsizei, const GLvoid*);
  399.     WINGDIAPI void APIENTRY glTexCoordPointerEXT(GLint, GLenum, GLsizei, GLsizei, const GLvoid*);
  400. #endif
  401.  
  402. /* These constants are used in the function enumeration scheme */
  403. #define NONE 0
  404. #define PER_VERTEX 1
  405. #define PER_FACET 2
  406. #define CI 0
  407. #if defined(WIN32)
  408.   #undef RGB
  409. #endif
  410. #define RGB 1
  411.  
  412. #endif /* file not already included */
  413. #endif /* INC_REASON not defined */
  414.